// pages/index04/index.js
Page({

    /**
     * 页面的初始数据
     */
    data: { 
      goodsList: [
        {
          id: 1,
          goodName: '1号商品',
          goodPrice: '77.8',
          goodOld: '365.5',
          desc: '【简约字母印花T恤】夏装时尚宽松圆领短袖休闲上衣女',
          imgUrl: '/images/goods/good1.jpg'
        },
        {
          id: 2,
          goodName: '2号商品',
          goodPrice: '77.8',
          goodOld: '365.5',
          desc: '【简约字母印花T恤】夏装时尚宽松圆领短袖休闲上衣女',
          imgUrl: '/images/goods/good2.jpg'
        },
        {
          id: 3,
          goodName: '3号商品',
          goodPrice: '77.8',
          goodOld: '365.5',
          desc: '【简约字母印花T恤】夏装时尚宽松圆领短袖休闲上衣女',
          imgUrl: '/images/goods/good3.jpg'
        },
        {
          id: 4,
          goodName: '4号商品',
          goodPrice: '77.8',
          goodOld: '365.5',
          desc: '【简约字母印花T恤】夏装时尚宽松圆领短袖休闲上衣女',
          imgUrl: '/images/goods/good4.jpg'
        },
        {
          id: 5,
          goodName: '5号商品',
          goodPrice: '77.8',
          goodOld: '365.5',
          desc: '【简约字母印花T恤】夏装时尚宽松圆领短袖休闲上衣女',
          imgUrl: '/images/goods/good5.jpg'
        }


      ],

      goodsList2: [
        {
          id: 6,
          goodName: '6号商品',
          goodPrice: '77.8',
          goodOld: '365.5',
          desc: '【简约字母印花T恤】夏装时尚宽松圆领短袖休闲上衣女',
          imgUrl: '/images/goods/good6.jpg'
        },
        {
          id: 7,
          goodName: '7号商品',
          goodPrice: '77.8',
          goodOld: '365.5',
          desc: '【简约字母印花T恤】夏装时尚宽松圆领短袖休闲上衣女',
          imgUrl: '/images/goods/good7.jpg'
        }
      ]


    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {
      console.log('监听用户下拉动作');
      
      this.setData({
        goodsList: this.data.goodsList2
      })


    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {
      console.log('页面上拉触底事件的处理函数');
      var index = this.data.goodsList.length - 1

      var newList = this.data.goodsList.concat(this.data.goodsList2)
      console.log(newList);
      this.setData({
        goodsList: newList
      })

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {

    }
})